#!/bin/sh

LUPDATE_OPTIONS="-noobsolete"

TS_FILES="flacon.ts.src"

SOURCES="SOURCES = "
for f in `ls ../*.py | grep -v "_ui.py"`; do
    SOURCES="$SOURCES $f"
done

for f in `ls ../encoders/*.py | grep -v "_ui.py"`; do
    SOURCES="$SOURCES $f"
done

FORMS="FORMS="
for f in `ls ../*.ui ../encoders/*.ui`; do
    FORMS="$FORMS $f"
done

PRO_FILE="../translations/flacon.pro"
echo "#Config"   > $PRO_FILE
echo "$SOURCES" >> $PRO_FILE
echo            >> $PRO_FILE
echo "$FORMS"   >> $PRO_FILE
echo            >> $PRO_FILE
echo "TRANSLATIONS = $TS_FILES" >> $PRO_FILE

cd ../translations && pylupdate4 $LUPDATE_OPTIONS $PRO_FILE

rm $PRO_FILE
